package Java多线程和并发.Java并发线程基础;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @program: algorithm
 * @description: 接口实现使用线程
 * @author: 陈恩涛
 * @create: 2022-02-18 10:10
 **/
public class TestThreadUsage {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        new Thread(() -> {
            System.out.println("11111");
        },"thread-01").start();

        FutureTask<Integer> task = new FutureTask<>(() -> 123);
        new Thread(task).start();
        System.out.println(task.get());
    }
}
